package com.topboya.officeuser.exception;

/**
 * @className ExceptionUtils
 * @Author xiaxin
 * @Date 2020/12/17 11:18
 * @Version 1.0
 **/
public class ExceptionUtils {

    public static RuntimeException sneakyThrow(Throwable t) {
        if (t == null) throw new NullPointerException("t");
        return ExceptionUtils.sneakyThrow0(t);
    }

    private static RuntimeException sneakyThrow0(Throwable t) {
        throw (RuntimeException) t;
    }

//    private static <T extends Throwable> T sneakyThrow0(Throwable t) throws T {
//        throw (T)t;
//    }

}
